package com.wsoft.core.exception;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.wsoft.service.IErrorCode;

/**
 * 断言处理类，用于抛出各种API异常
 *
 * @author: juiet
 * @date: 2022年06月15日 17:11
 */
public class Asserts {
    public static final Logger logger = LoggerFactory.getLogger(Asserts.class);

    public static void fail(String message) {
        logger.error(message);
        throw new ApiException(message);
    }

    public static void fail(IErrorCode errorCode) {
        throw new ApiException(errorCode);
    }
}
